package com.igeek.clud_system.controller;

import com.igeek.clud_system.common.Const;
import com.igeek.clud_system.pojo.ResponseResult;

import jakarta.servlet.http.HttpSession;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
@RestController
public class LoginVerify  {
	@RequestMapping("loginVerify")
	public ResponseResult  execute(HttpSession session) {
		System.out.println("进入登录验证");
		ResponseResult result = new ResponseResult();
		if(session.getAttribute(Const.LOGIN_USER)!=null){
			result.setState(200);
			result.setMessage("登陆成功");
			System.out.println();
			result.put("loginUser",session.getAttribute(Const.LOGIN_USER));

		}
		else {
			result.setState(300);
			result.setMessage("请先登录");
		}
		return result;
	}
}
